import { Component } from '@angular/core';
import { IonicPage, NavController, NavParams } from 'ionic-angular';
import {  Factory  }           from "./service";


@IonicPage()
@Component({
  selector: 'page-cases',
  templateUrl: 'cases.html',
  providers: [ Factory ]
})
export class CasesPage {
  public service: any;
  public employees =[ 
    { name:'nes',value:'nes',id:1 },
    { name:'nes2',value:'nes2',id:21 },
    { name:'nes3',value:'nes3',id:221 },
  ];
  public casres: string = "normal";
  private employeer     ='nes';
  // private secondClasic  : any;

  constructor(
    public _factory:Factory,
    public navCtrl: NavController, 
    public navParams: NavParams,
    ) {
  }
  ionViewDidLoad() {
     this.service = this._factory.getService();
     this.getCases();
  }
  getCases(){
    this.service.getCases({page:1,size:10}).then(res =>{
      console.log(res);
     })
  }

  testpostFn(){
    this.service.testPost({
  "feedbackcontent": "22222222"
}).then(res =>{
      console.log(res);
     })
  }

  clearClicked(){
    console.log('clearClicked');
  }
  goToClassicPageFn(){
    this.navCtrl.push('ClassicCasesPage');
  }
  goToCaseDetailFn(){
    this.navCtrl.push('NormalCasesPage');
  }
}
  // createCaseFn(){
  //   this.navCtrl.push('CasesPage');
  // }

  // showdata(){
  //   console.log(this.employeer);
  //   console.log(this.secondClasic);
  // }
